#pragma once
#include <osg/PrimitiveSet>

#include "Ent.h"

class JsonReader;
class Surface;
struct CylinderPrivate;
class Cylinder : public Ent3DFace
{
	Q_OBJECT
public:
	Cylinder(INode* parent);
	void setBottomCenter(const osg::Vec3d& pos);
	void setAxis(const osg::Vec3d& axis);
	void setRadius(double radius);
	void setHeight(double height);
	virtual void update3D() override;
	virtual osg::Node* getRep3D() const override;
	virtual void setSelected(bool val) override;
	virtual void save(QJsonObject &json) const;
	virtual void load(const QJsonObject& json, JsonReader& reader);
	virtual std::vector<osg::Vec3d> handles() const override;
	virtual void move(const osg::Vec3d& offset) override;
	virtual std::shared_ptr<Ent> clone() const override;
	virtual void copy(const Ent& ent) override;
	std::set<std::shared_ptr<INode>> decompose() const;
	virtual void rotate(const double angle, const osg::Vec2d& basePoint) override;
	LEAF_METHODS;

protected:
	CylinderPrivate* d_ptr;
};
